﻿@model PhotoGallery.Models.AudioInfo
@using PhotoGallery.Views

@{
    ViewBag.Title = "Edit";
}
@section javascript{
    <script src="@Url.Content("~/Scripts/InputTypeFile.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/InputTypeFile.css")" rel="stylesheet" />
}
<h2>@Labels.edit</h2>

@using (Html.BeginForm(Html.BeginForm("Edit", "Audio", FormMethod.Post, new { enctype = "multipart/form-data" })))
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>@Labels.audio</legend>
        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.FileName)
        @Html.HiddenFor(model => model.Thumbnail)

        @if (String.IsNullOrEmpty(Model.Thumbnail))
        {
            <img alt="" src="@Url.Content("~//Content//audio.jpg")" class="thumbnail-border" width="180" height="180" />
        }
        else
        {
            <img alt="@Model.Title" src="@Url.Action("Thumbnail", new { file = Model.FullThumbnailName})"/>
        }
        <div class="editor-label">
            @Labels.uploadFile:<br>
        </div>
        <div class="editor-field"> 
            <div class="styleFileInput">        
              <input type="text" class="browseText" /> 
              <input type="button" value="Browse" class="browseButton" /> 
               <input type="file" name="file"  accept="audio/*" class="theFileInput ">
            </div>      
        </div>
        <div class="editor-label">
            @Labels.uploadThumbnail:<br>
        </div>
        <div class="editor-field">
            <div class="styleFileInput">        
              <input type="text" class="browseText" /> 
              <input type="button" value="Browse" class="browseButton" /> 
               <input type="file" name="thummnail"  accept="image/*" class="theFileInput">
            </div>      
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>
        @*<div class="editor-label">
            @Html.LabelFor(model => model.UploadDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UploadDate)
            @Html.ValidationMessageFor(model => model.UploadDate)
        </div>*@

        <p>
            <input type="submit" value="@Labels.save" />
            <a href="@Html.Encode(@Html.Encode(ViewBag.backUrl))" class="button-link-100" >@Labels.cancel </a>
       </p>
    </fieldset>
}